<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="lijun; 67086071; zwlijun@qq.com" />
<title> Calendar </title>
<script type="text/javascript" src="../core.js"></script>
<script type="text/javascript" src="calendar.js"></script>
</head>

<body>
<input type="text" id="date" value="%d/%M/%y" /><button id="date_show">show it</button><input type="text" id="date2" value="yyyymmdd" readonly="readonly" /><input type="text" id="date3" value="mm/dd,week" readonly="readonly" /><!--<button type="button" onclick="cal.show(this, 'date', 0, 24, '%d/%M/%y');">双日历</button><button type="button" onclick="cal1.show(this, 'date', -305, 24, null);">多日历（时间范围 - 可选）</button><button type="button" onclick="cal2.show(this, 'date', -305, 24, null);">多日历（时间范围 - 不可选）</button><button type="button" onclick="cal3.show(this, 'date', 0, 24, null);">单日历（时间范围 - 可选）</button><button type="button" onclick="cal4.show(this, 'date', 0, 24, null);">单日历（时间范围 - 不可选）</button>-->
</body>
<script type="text/javascript">
function t(d){
  //alert(d.format("%y-%M-%d %h:%m:%s"));
  document.getElementById("date").value = d.format("%d/%M/%y");
}
function t2(d){
  //alert(d.format("%y-%M-%d %h:%m:%s"));
  document.getElementById("date2").value = d.format("%y%M%d");
}
function t3(d){
  //alert(d.format("%y-%M-%d %h:%m:%s"));
  document.getElementById("date3").value = d.format("%M/%d, %w");
}
var cal = new XLib.Calendar();
cal.init({
  id:0,
  size:2,
  rows:1,
  cols:2,
  range:{start:null, end:null, disabled:false},
  namespace:'cal',
  bind : [{
    ref:['date', 'date_show'],
    input:'date',
    handler : t,
    args : []
  },{
    ref:'date2',
    input:'date2',
    handler : t2,
    args : []
  },{
    ref:'date3',
    input:'date3',
    handler : t3,
    args : []
  }],
  offsetX:0,
  offsetY:20,
  bindNext:true
});
</script>
</html>
